home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-12-20 | 1.3 KB | 36 lines | [TEXT/GEOL] |
- Item 8646736 18-Dec-89 05:25
-
- From: SCHMUCKER1 Schmucker, Kurt
-
- To: D2022 Strata, Gary Bringhurst,PRT
-
- cc: CPLUS.APPLE$ C++ Interest List--Apple Employees
- CPLUS.DEV$ C++ Interest List--Developers
- NASSI Nassi, Ike
-
- Sub: Re: What gives here?
-
- Gary,
-
- This is what I believe is happening in your code (but I am still a C++
- novice):
-
- There are two "overs" in your code: overriding and overloading. Bjarne
- made the decision that overriding is stronger than overloading, hence
- overriding a foo method in a derived class hides ALL foos in any ancestor
- classes, regardless of their parameter lists. Apparently, (as your example
- shows), if you override all the foos, then it works out correctly.
-
- Don't you just love it when a language has fun, little quirky interactions
- like this between features?
-
- I also found this principle of "overriding is stronger than overloading"
- puzzling and in the current working draft definition of the next version of
- Object Pascal, we have these two concepts orthogonal, and thus, overriding
- foo(int) does not hide foo(real) or foo(string).
-
-
- Kurt Schmucker
- Apple Computer
-
-